<template>
  <el-dialog title="编辑" :visible.sync="dialogVisible" :before-close="cancelDialog">
    <div style="height: 500px; overflow: hidden; overflow-y: scroll">
      <el-form class="form">
        <el-form-item label="评分名称" prop="scoreName">
          <el-input v-model="dialogInfo.scoreName" />
        </el-form-item>

        <el-form-item label="类型" prop="type">
          <el-input v-model="dialogInfo.type" />
        </el-form-item>

        <el-form-item label="排序" prop="sortNum">
          <el-input v-model="dialogInfo.sortNum" />
        </el-form-item>
        <el-form-item label="分类" prop="scoreType">
          <el-select v-model="dialogInfo.scoreType" placeholder="请选择分类">
            <el-option label="重症相关" value="重症相关" />
            <el-option label="儿科相关" value="儿科相关" />
            <el-option label="麻醉相关" value="麻醉相关" />
          </el-select>
        </el-form-item>
        <el-form-item label="描述" prop="description">
          <el-input v-model="dialogInfo.description" type="textarea" />
        </el-form-item>
        <el-form-item label="图例" prop="legend">
          <el-input v-model="dialogInfo.legend" type="textarea" />
        </el-form-item>
        <el-form-item label="评分规则描述" prop="scoreRule">
          <el-input v-model="dialogInfo.scoreRule" type="textarea" />
        </el-form-item>
        <el-form-item label="评估时机描述" prop="scoreOpportunity">
          <el-input
            v-model="dialogInfo.scoreOpportunity"
            type="textarea"
          />
        </el-form-item>
        <el-form-item label="录入护理措施" prop="showNursing">
          <el-switch v-model="dialogInfo.showNursing" />
        </el-form-item>
        <el-form-item label="护理措施" prop="nursingStep">
          <el-input v-model="dialogInfo.nursingStep" type="textarea" />
        </el-form-item>
        <el-form-item label="录入其他措施" prop="showOtherStep">
          <el-switch v-model="dialogInfo.showOtherStep" />
        </el-form-item>
        <el-form-item label="录入签名" prop="showSignature">
          <el-switch v-model="dialogInfo.showSignature" />
        </el-form-item>
        <el-form-item label="智能评分" prop="showSmartScore">
          <el-switch v-model="dialogInfo.showSmartScore" />
        </el-form-item>
        <el-form-item label="同步护理单" prop="synReport">
          <el-switch v-model="dialogInfo.synReport" />
        </el-form-item>
        <el-form-item label="关联护理单" prop="reportType">
          <el-input v-model="dialogInfo.reportType" type="textarea" />
        </el-form-item>
        <el-form-item label="护理单编码" prop="reportCode">
          <el-input v-model="dialogInfo.reportCode" type="textarea" />
        </el-form-item>
        <el-form-item label="同步评估单" prop="synAssessment">
          <el-switch v-model="dialogInfo.synAssessment" />
        </el-form-item>
        <el-form-item label="关联评估单" prop="assessmentType">
          <el-input
            v-model="dialogInfo.assessmentType"
            type="textarea"
          />
        </el-form-item>
        <el-form-item label="评估单编码" prop="assessmentCode">
          <el-input
            v-model="dialogInfo.assessmentCode"
            type="textarea"
          />
        </el-form-item>
        <el-form-item label="同步至护理记录" prop="synNursing">
          <el-switch v-model="dialogInfo.synNursing" />
        </el-form-item>
        <el-form-item label="是否统计" prop="hasStatistics">
          <el-switch v-model="dialogInfo.hasStatistics" />
        </el-form-item>
        <el-form-item label="统计格式日期" prop="dateType">
          <el-input v-model="dialogInfo.dateType">YYYY-MM-DD HH:mm:ss</el-input>
        </el-form-item>
        <el-form-item label="状态" prop="status">
          <el-switch v-model="dialogInfo.status" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="cancelDialog_quxiao">取 消</el-button>
        <el-button type="primary" @click="cancelDialog">确 定</el-button>
      </div>
    </div>
  </el-dialog>
</template>

<script>
import { scoreDictionaryedit } from '@/api/table'
import axios from 'axios'

export default {
  name: 'Index',
  components: {},
  // 父组件 传 过来的 值
  props: {
    dialogVisible: {
      type: Boolean,
      default: false
    },
    dialogInfo: {
      type: Object,
      default: {}
    }
  },
  data() {
    return {
      list: {
        bed_name: '',
        id: '',
        sattus: ''
      }
    }
  },
  data() {
    return {}
  },
  watch: {
    // 监听 弹窗显示， 可以用来写 请求接口
    dialogVisible: function(newVal, oldVal) {
      if (newVal) {
        console.log(newVal)
      }
    }
  },
  created() {},
  mounted() {},
  methods: {
    cancelDialog_quxiao() {
      this.$emit('update:dialogVisible', false)
    },
    // 修改父组件传过来的值
    cancelDialog() {
      this.$emit('update:dialogVisible', false)
      edit({
        id: this.dialogInfo.id,
        status: this.dialogInfo.status,
        bedName: this.dialogInfo.bed_name
      }).then((res) => {})
    }
  }
}
</script>
<style lang='scss' scoped>
.form {
  padding: 0 10px;
}

</style>
